package com.sino.man.controller;

import com.sino.man.util.RedisUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
@RequestMapping("/redis")
public class RedisController {
    @Autowired
    private RedisUtil redisUtils;


    @GetMapping("test-set-string")
    public String testSetString(String key, String value) {
        redisUtils.set(key, value,60L);
        return "success set string";
    }

    @GetMapping("test-get-string")
    public String testGetString(String key) {
        return redisUtils.get(key).toString();
    }

}
